<html>
<head><meta charset="utf-8"><title>more precise auto traits in generators · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/more.20precise.20auto.20traits.20in.20generators.html">more precise auto traits in generators</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="177718753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/more%20precise%20auto%20traits%20in%20generators/near/177718753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/more.20precise.20auto.20traits.20in.20generators.html#177718753">(Oct 09 2019 at 14:27)</a>:</h4>
<p>OK, I did some investigation (<a href="https://github.com/rust-lang/rust/issues/57017#issuecomment-540023781" target="_blank" title="https://github.com/rust-lang/rust/issues/57017#issuecomment-540023781">comment</a>) into what it would take to get more precise "auto traits" for generators. The short version is that it is non-trivial to do. </p>
<p>A couple of thoughts:</p>
<ul>
<li>I'm tempted to create a fresh "tracking issue" for this problem and to start closing existing issues like <a href="https://github.com/rust-lang/rust/issues/57017" target="_blank" title="https://github.com/rust-lang/rust/issues/57017">#57017</a>, while collecting their examples. I just find it annoying when the issue for a fairly general problem begins with a discussion of narrow specifics.</li>
<li>I feel like we should be collecting notes about how generators are implemented and in particular the queries they invoke and when, as it currently requires a kind of "deep dive" into the code. The goal would be to be drafting a rustc-guide chapter, in short, but also to help visualize new designs. To me this feels like prime material for a "async-foundations" tracking repository. I am tempted to create one. It's a bit of a ret-con but that's ok.</li>
<li>It's not going to be <em>trivial</em> to first build the MIR. It doesn't strike me as <em>impossible</em> though, it'll just require some careful thought -- for example, we might be able to build the MIR for internal generators before completing the outer function if we reshuffle the current setup somewhat.</li>
</ul>



<a name="179078018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/more%20precise%20auto%20traits%20in%20generators/near/179078018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/more.20precise.20auto.20traits.20in.20generators.html#179078018">(Oct 25 2019 at 18:45)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="125294">@Aaron Hill</span> -- do you think we could schedule a time next week to sync chat about your plans? I'd like to understand better what you have in mind! I see you've been doing a lot here</p>



<a name="179078159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/more%20precise%20auto%20traits%20in%20generators/near/179078159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/more.20precise.20auto.20traits.20in.20generators.html#179078159">(Oct 25 2019 at 18:46)</a>:</h4>
<p>( Maybe we can also loop in <span class="user-mention" data-user-id="116466">@Zoxc</span> )</p>



<a name="179093808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/more%20precise%20auto%20traits%20in%20generators/near/179093808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/more.20precise.20auto.20traits.20in.20generators.html#179093808">(Oct 25 2019 at 22:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Sorry - looks like this was another message that I missed. Let me know when a good time would be for you.</p>



<a name="179127280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/more%20precise%20auto%20traits%20in%20generators/near/179127280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/more.20precise.20auto.20traits.20in.20generators.html#179127280">(Oct 26 2019 at 14:05)</a>:</h4>
<p>I would also like to be looped in, it seems to me that Ralf, eddyb et. al should also be</p>



<a name="179351803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/more%20precise%20auto%20traits%20in%20generators/near/179351803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/more.20precise.20auto.20traits.20in.20generators.html#179351803">(Oct 29 2019 at 17:17)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> </p>
<blockquote>
<p>Sorry - looks like this was another message that I missed. Let me know when a good time would be for you.</p>
</blockquote>
<p>A good question! I was going to suggest maybe tomorrow morning (boston time), but I had some last minute meetings get scheduled, so I'm not sure how available I am then. There might be time on Friday, but maybe it's easiest if I just create a doodle.</p>



<a name="179352550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/more%20precise%20auto%20traits%20in%20generators/near/179352550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/more.20precise.20auto.20traits.20in.20generators.html#179352550">(Oct 29 2019 at 17:25)</a>:</h4>
<p>A doodle sounds good to me. I'll be available Friday afternoon</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>